package com.xpgk.mvc.bcost;


import java.util.Date;
import java.util.List;

import com.jfinal.log.Log;
import com.xpgk.annotation.Service;
import com.xpgk.constant.ConstantRender;
import com.xpgk.mvc.base.BaseService;


@Service(name = BcostService.serviceName)
public class BcostService extends  BaseService{
	
	
	@SuppressWarnings("unused")
	private static final Log log = Log.getLog(BcostService.class);
	public static final String serviceName = "bcostService";
	
	
	public  String  saveBcost(String userids,String orgids,List<SbPay> spList)
	{
		String msg=ConstantRender.render_success_code;
		if(spList!=null &&  spList.size()>0)
		{
			for(SbPay  sp:spList)
			{
				sp.set(SbPay.column_userIds, userids)
					.set(SbPay.column_organizationIds, orgids)
					.set(SbPay.column_gxsj, new Date());
				if(!sp.save())
				{
					log.debug("保存费用支出失败");
					throw new RuntimeException("保存费用支出失败!");
				}
			}
		}
		
		return  msg;
	}
}
